Skip to content

Conversation

@adelajaworowska
Copy link

@adelajaworowska adelajaworowska commented Jan 12, 2026

Fixes debezium/dbz#1518

When compatibility mode is set TransactionPayloadEventDataDeserializer() should be aware about it and in deserialize method when it creates new deserializer EventDeserializer transactionPayloadEventDeserializer = new EventDeserializer(); it should set compatibility mode from top level object.

FYI, the issue was also raised in osheroff repo: osheroff#127, osheroff#138 but never addressed.

@jpechane
Copy link

@adelajaworowska Unfortunately as you are aware the CI is now broken so I'd be glad if you could run the tests locally and let me know if they passes when the PR is ready for review. Thanks for understanding.

new MariadbGtidListEventDataDeserializer());
eventDataDeserializers.put(EventType.TRANSACTION_PAYLOAD,
new TransactionPayloadEventDataDeserializer());
new TransactionPayloadEventDataDeserializer(this));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about other deserializers? Does only TransactionPayloadEventDataDeserializer needs to have this parameters?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went through all other deserializers' code and TransactionPayloadEventDataDeserializer is the only one that needs a fix

public static final int OTW_PAYLOAD_COMPRESSION_TYPE_FIELD = 2;
public static final int OTW_PAYLOAD_UNCOMPRESSED_SIZE_FIELD = 3;

private final EventDeserializer parentEventDeserializer;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this cause cyclic reference?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. I changed the approach.

@adelajaworowska adelajaworowska force-pushed the eventDeserializer-composition-fix branch from 9c922e6 to 99a612e Compare January 14, 2026 10:26
if (eventDataDeserializer instanceof TransactionPayloadEventDataDeserializer) {
TransactionPayloadEventDataDeserializer deserializer =
(TransactionPayloadEventDataDeserializer) eventDataDeserializer;
if (!compatibilitySet.isEmpty()) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this works for newly created EventDeserializer when you first set compatibility mode. But then if someone's case is to remove compatibility mode it will stay inside TransactionPayloadEventDataDeserializer. Doesn't it? I assume always compatibilitySet should propagate relevant to TransactionPayloadEventDataDeserializer no matter if it is set or unset.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently the library gives us no way to remove compatibilityMode. The only method we can call is setCompatibilityMode() that enforce at least one argument.
But in case it is changed in the future, I modified this code so we just take compatibilitySet as it is and pass it to TransactionPayloadEventDataDeserializer. WDYT now?

@adelajaworowska adelajaworowska force-pushed the eventDeserializer-composition-fix branch 2 times, most recently from 9657ad3 to 17553e6 Compare January 16, 2026 13:32
@adelajaworowska adelajaworowska force-pushed the eventDeserializer-composition-fix branch from 4d5e649 to 50f3484 Compare January 19, 2026 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EventDeserializer composition in mysql-binlog-connector-java library should be fixed

3 participants